<template>
  <div class="get-info-with-type">
    <div class="title">包裹类型库存剩余数</div>
    <div class="chart" id="typeChart"></div>
  </div>
</template>

<script>
export default {
  name: "get-info-with-type",
  data() {
    return {
      option: {
        legend: {
          type: "scroll",
          itemWidth: 10, // 设置宽度
          icon: "circle",
          itemHeight: 10, // 设置高度
          top: "bottom",
          textStyle: {
            fontSize: 16,
            color: "#FFFFFF",
          },
        },
        series: [
          {
            name: "面积模式",
            type: "pie",
            radius: [20, 120],
            center: ["50%", "50%"],
            roseType: "area",
            itemStyle: {
              borderRadius: 0,
              normal: {
                label: {
                  show: true,
                  color: "#ffffff",
                  fontSize: 16,
                },
              },
            },
            data: [
              { value: 40, name: "纸盒" },
              { value: 38, name: "泡沫" },
              { value: 32, name: "环保袋" },
              { value: 30, name: "塑料" },
              { value: 28, name: "胶带" },
              { value: 40, name: "纸盒1" },
              { value: 38, name: "泡沫1" },
              { value: 32, name: "环保袋1" },
              { value: 30, name: "塑料1" },
              { value: 28, name: "胶带1" },
            ],
          },
        ],
      },
    };
  },
  mounted() {
    const chartDom = document.getElementById("typeChart");
    const myChart = this.$echarts.init(chartDom);
    myChart.setOption(this.option);
  },
};
</script>

<style lang="scss" scoped>
.get-info-with-type {
  width: 453px;
  height: 437px;

  .title {
    height: 60px;
    line-height: 60px;
    padding-left: 33px;
    font-weight: bold;
    font-size: 24px;
    color: #ffffff;
  }
  .chart {
    height: 377px;
  }
}
</style>